package com.tangcco.lockwell.service.impl;

import com.tangcco.lockwell.domain.TopicNalysis;
import com.tangcco.lockwell.domain.dto.TopicNalysisDto;
import com.tangcco.lockwell.repository.BaseMapper;
import com.tangcco.lockwell.repository.TopicNalysisMapper;
import com.tangcco.lockwell.service.TopicNalysisService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TopicNalysisImpl extends BaseServiceImpl<TopicNalysis> implements TopicNalysisService {
    public TopicNalysisImpl(BaseMapper<TopicNalysis> baseMapper) {
        super(baseMapper);
    }
    @Resource
    private TopicNalysisMapper topicNalysisMapper;

    //增加
    public int insert(TopicNalysis topicNalysis) {
        return topicNalysisMapper.insert(topicNalysis);
    }
    //删除
    public int deleteById(Integer id) {
        return topicNalysisMapper.deleteByPrimaryKey(id);
    }
    //修改
    public int updateById(TopicNalysis topicNalysis) {
        return topicNalysisMapper.updateByPrimaryKeySelective(topicNalysis);
    }
    //查询
    public TopicNalysis selectById(Integer id) {
        return topicNalysisMapper.selectByPrimaryKey(id);
    }

    /**
     * 长难句解析查询
     * @param questionId
     * @return
     */
    @Override
    public List<TopicNalysis> selectForLongSentenceAnalysis(Integer questionId,Integer paragraph) {
        return topicNalysisMapper.selectForLongSentenceAnalysis(questionId,paragraph);
    }

    /**
     * 长难句解析查询
     * @param topicNalysis
     * @return
     */
    @Override
    public List<TopicNalysis> selectByCondition(TopicNalysisDto topicNalysis) {
        return topicNalysisMapper.selectByCondition(topicNalysis);
    }


}
